package com.pointcircle.core.web;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.pointcircle.core.JpaBaseEntity;

public abstract class EntityVo<T extends JpaBaseEntity<ID>, ID extends Serializable> {
	
	protected T entity;
	
	public EntityVo(T entity) {
		this.entity = entity;
	}
	@JsonProperty(value = "id")
	public ID getId() {
		return entity.getId();
	}
	@JsonProperty(value = "createTime")
	public Long getCreateTime() {
		return entity.getCreateTime() == null ? null : entity.getCreateTime().getTime();
	}
	@JsonProperty(value = "updateTime")
	public Long getUpdateTime() {
		return entity.getUpdateTime() == null ? null : entity.getUpdateTime().getTime();
	}
}
